package bean;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.IdClass;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

@Entity
@IdClass(FundPriceHistoryPk.class)
public class FundPriceHistory {
	private Fund fund;
	private Date priceDate;
	private long price;

	@Id
	@ManyToOne
	@JoinColumn(name="fundId")
	public Fund getFund() {
		return fund;
	}

	public void setFund(Fund fund) {
		this.fund = fund;
	}
	
	@Id
	@Column(columnDefinition="DATE")
	@Temporal(TemporalType.DATE)
	public Date getPriceDate() {
		return priceDate;
	}
	
	public void setPriceDate(Date priceDate) {
		this.priceDate = priceDate;
	}
	
	@Column(nullable=false)
	public long getPrice() {
		return price;
	}
	
	public void setPrice(long price) {
		this.price = price;
	}


}
